package cn.itsource.pethome.basic.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * ajax结果返回
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResult {
    /**
     * 成功
     */
    private Boolean success = true;
    /**
     * 错误信息
     */
    private String msg;
    ////返回到前台的数据
    private Object result;

    public AjaxResult(Boolean success,String msg){
        this.success = success;
        this.msg = msg;
    }

    /**
     * 设置返回到前端的数据
     * @param result
     * @return
     */
    public  AjaxResult setResult(Object result) {
        this.result = result;
        return this;
    }


}
